package _02_greedy_algorithm.huffmantree;

import org.junit.jupiter.api.Test;

import java.util.PriorityQueue;

/**
 * @author: mornd
 * @dateTime: 2023/7/20 - 11:56
 */
public class MyTest {

    @Test
    public void test1() {
        HuffmanTree huffmanTree = new HuffmanTree("abbcccc");
        huffmanTree.printCodeValue();
        String encode = huffmanTree.encode();
        System.out.println(encode);
        System.out.println(huffmanTree.decode(encode));
        System.out.println("共占用bits：" + huffmanTree.bits);
    }
}
